Modern storage systems are configured to enable providing copies of existing data for purposes of backup, possible restore in case of future data corruption, testing, etc. The copies may be provided with the help of backup and/or snapshot techniques. The use of snapshot techniques greatly reduces the amount of storage space required for archiving large amounts of data.
Problems of operating storage systems in the presence of a plurality of snapshots have been recognized in the conventional art and various techniques have been developed to provide solutions. For example:
US Patent Application No. 2011/0119459 (Satoyama et al.) discloses a storage system including a storage device which configures an original volume for storing data which is read/written by a host, a copy volume for storing a copy of the original volume at a predetermined timing, and a snapshot volume for storing a snapshot data which is a snapshot of the original volume; and a controller which controls access from the host to the storage device. The controller copies data of the original volume to the copy volume at a predetermined timing; stores the snapshot data in the snapshot volume corresponding to a write request to the original volume without decreasing a performance of the original volume; manages a generation of the stored snapshot according to predetermined copy volume blocks and snapshot volume blocks, and manages a generation of the copy volume; and reads data from the snapshot volume and/or the copy volume when a read request to a volume of a generation different from that of the original volume is received from the host, without decreasing a performance of the original volume.
US Patent Application No. 2008/172542 (Kaushik) discloses a method, apparatus and system of a hierarchy of a structure of a volume. In one embodiment, a system includes a physical volume, a structure to provide a mapping to a location of a data segment of the physical volume that may include a table having a hierarchy, a logical volume management module to define a logical volume as an arrangement of the physical volume, a snapshot module that may automatically generate a point-in-time image of the logical volume, may prompt the logical volume management module to create and insert a first table and a second table into the hierarchy of the structure, the first table may provide a set of updates to the logical volume, the second table may provide a set of updates to the point-in-time image, and a data processing system to perform a write IO operation and a read IO operation.
US Patent Application 2008/301203 (Adkins et al.) discloses an embodiment where at least one snapshot thread manages a point in time snapshot of a file system stored within the space allocated to the file system. The snapshot thread tracks, for at least one block of the plurality of blocks of the file system, a separate entry in a snapshot map specifying if each at least one block is newly allocated following the creation of the point in time snapshot and specifying an addressed location of a snapshot copy of the at least one block, if copied. Separately, a file system handling thread tracks a mapping of an allocation state of each of said plurality of blocks of the file system. Responsive to detecting the file system triggered to write or delete a particular block from among the at least one block of the file system, the snapshot thread allows the file system to write to or delete the particular block without making a snapshot copy of the particular block if a particular entry for the particular block in the snapshot map specifies the particular block is newly allocated, wherein a block marked newly allocated was not in-use at the point in time of the file system snapshot.
U.S. Pat. No. 6,038,639 (O'Brien et al.) discloses a data file storage management system for snapshot copy operations which maintains a two level mapping table enabling the data files to be copied using the snapshot copy process and only having to update a single corresponding mapping table entry when the physical location of the data file is changed. The snapshot copy updates to the contents of the first level of the two level mapping table, which are stored on the backend data storage devices to provide a record of the snapshot copy operation which can be used to recover the correct contents of the mapping table. This record of the snapshot copy operations remains valid even though the physical location of a copied data file instance is subsequently changed. Furthermore, the physical storage space holding the updated portions of the first level of the two level mapping table can be managed using techniques like those used to manage the physical storage space holding data file instances. Mapping table updates resulting from the snapshot copy operation are delayed until all mapping table updates resulting from earlier data file write operations have been completed and any attempt to update the mapping table to reflect data written to the original data file or the copy data file that occurs after initiation of the copy must wait until the first set of mapping table pointers have been copied.
U.S. Pat. No. 7,165,156 (Cameron, et al.) discloses a chain of snapshots including read-write snapshots descending from a read only snapshot. The read only snapshots present a constant view of the data at the time the read only snapshot is created, and the read-write snapshot starts with the view but can be modified by the user without changing the view of its parent snapshot (e.g., the read only snapshot). The read-write snapshot can be written for various testing purposes while the read only snapshot remains undisturbed to preserve the original data.
General Description
In accordance with certain aspects of the presently disclosed subject matter, there is provided a method of operating a storage system. The storage system is operable to manage a plurality of snapshot families, each snapshot family (SF) is constituted by SF members comprising a master logical volume and a plurality of snapshots corresponding thereto and is characterized by a SF logical address space associated with the SF. The method comprises generating in the storage system, for each given SF among the plurality of snapshot families, a corresponding first SF mapping data structure comprising one or more entries, wherein each entry is associated with a variable range of contiguous logical addresses within the SF logical address space and is characterized by a value indicative of length of the range and its offset in the SF logical address space, and wherein each entry in the first SF mapping data structure is further associated with a second SF data structure configured to provide mapping between the range of contiguous logical addresses associated with the entry into one or more physical address ranges, respectively correlated to the SF members. The method further comprises, upon receiving an access request specifying an addressed LUN and LBA range, the storage system identifying an addressed snapshot family and an addressed member therein corresponding to the addressed LUN; the storage system searching a first SF mapping data structure associated with the identified addresses SF for entry associated with a range of contiguous logical addresses corresponding to LBA range specified in the access request; and the storage system searching a respective second SF mapping data structure associated with the entry found in the first SF mapping data structure for identifying physical addresses corresponding to the requested LBA range in the addressed member of the addressed snapshot family.
In accordance with further aspects of the presently disclosed subject matter, the second SF mapping data structure can be configured to present any given range of physical addresses by one and only one representative member among the SF members sharing the given range of physical addresses. In case the addressed member of the addressed snapshot family is omitted in the respective second SF mapping data structure, the method can further comprise determining a respective representative member sharing physical addresses with the addressed member, and using physical address range correlated to the detected representative member as corresponding to the requested LBA range. The respective representative member can be determined in accordance with a predefined rule related to hierarchical and sequential relations between members of the addressed snapshot family. Determining the respective representative member sharing physical addresses with the addressed member, searching the respective second SF mapping data structure and identifying physical addresses corresponding to the requested LBA range can be provided as a single atomic operation.
In accordance with further aspects of the presently disclosed subject matter, the method can further comprise associating data received in the access request for writing with a first value indicative of the most recent snapshot which existed in the storage system at the time of writing the received data to a cache memory, and writing, to the cache memory, the received data in association with the first value and with a second value indicative of the addressed SF member.
In accordance with other aspects of the presently disclosed subject matter, there is provided a storage system comprising a plurality of physical storage devices controlled by a plurality of storage control devices constituting a storage control layer operatively coupled to a plurality of hosts and to the plurality of physical storage devices constituting a physical storage space, said control layer configured to manage a plurality of snapshot families, each snapshot family (SF) is constituted by SF members comprising a master logical volume and a plurality of snapshots corresponding thereto and is characterized by a SF logical address space associated with the SF. The control layer comprises means for generating, for each given SF among the plurality of snapshot families, a corresponding first SF mapping data structure comprising one or more entries, wherein each entry is associated with a variable range of contiguous logical addresses within the SF logical address space and is characterized by a value indicative of length of the range and its offset in the SF logical address space, and wherein each entry in the first SF mapping data structure is further associated with a second SF data structure configured to provide mapping between the range of contiguous logical addresses associated with the entry into one or more physical address ranges, respectively correlated to the SF members. The control layer further comprises means for identifying an addressed snapshot family and an addressed member therein corresponding to the addressed LUN upon receiving an access request specifying an addressed LUN and LBA range; means for searching a first SF mapping data structure associated with the identified addresses SF for entry associated with a range of contiguous logical addresses corresponding to LBA range specified in the access request; and means for searching a respective second SF mapping data structure associated with the entry found in the first SF mapping data structure for identifying physical addresses corresponding to the requested LBA range in the addressed member of the addressed snapshot family.
The control layer can further comprise means for associating data received in the access request for writing with a first value indicative of the most recent snapshot which existed in the storage system at the time of writing the received data to a cache memory, and means for writing, to the cache memory, the received data in association with the first value and with a second value indicative of the addressed SF member.
In accordance with other aspects of the presently disclosed subject matter, there is provided a method comprising the following operations provided by a storage system capable to maintain a snapshot family comprising a plurality of members having hierarchical relations therebetween: generating a mapping data structure comprising a plurality of mapping entries providing mapping for respective logical address ranges within a logical address space assigned to the snapshot family; configuring a mapping entry of the plurality of mapping entries to comprise one or more mappings for mapping a logical address range associated with the mapping entry into one or more physical address ranges, respectively correlated to one or more representative members of the snapshot family; omitting from the mapping entry a certain mapping corresponding to an omitted member comprised in the snapshot family and different from any of the one or more representative members sharing a respective range of physical addresses; and responsive to an access request directed to the logical address range and the omitted member, determining a representative member from the one or more representative members, the determining being provided using a predefined rule related to the hierarchical and sequential relations between members of the snapshot family; and responding to the access request by using a physical address range correlated to the representative member.
The mapping data structure can be configured to present a given range of physical addresses by one and only one representative member among the members sharing the given range of physical addresses. A size of the logical address space assigned to the family can be equal to size of logical address space of each of the members of the snapshot family, wherein each given offset in the respective snapshot family logical address space corresponds to a respective offset in any of the snapshot family's members.
In accordance with further aspects of the presently disclosed subject matter, the above methods can further comprise omitting from the mapping entry a mapping corresponding to any newly added member.
In accordance with further aspects of the presently disclosed subject matter, operations related to modification of hierarchical relations between members of the snapshot family can be provided as a foreground process and operations related to respective modification of the mapping structure can be provided as a background process.